/**
 * @file   CoderXML_Building.h
 * @brief   
 *
 ****************************************************************************
 * @version $Id: CoderXML_Building.h 1968 2010-02-27 05:52:38Z alex $
 * @author  Alessandro Polo
 ****************************************************************************/
/* Copyright (c) 2007-2010, WOSH - Wide Open Smart Home 
 * by Alessandro Polo - OpenSmartHome.com
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of the OpenSmartHome.com WOSH nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY Alessandro Polo ''AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL Alessandro Polo BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ****************************************************************************/

#ifndef __WOSH_DataBase_CoderXML_Building_H__
 #define __WOSH_DataBase_CoderXML_Building_H__

 #include <framework/database/SerializableXML.h>

 #include <framework/building/BuildingObject.h>
 #include <framework/building/BuildingGeometry.h>

 #include <framework/building/Appliance.h>
 #include <framework/building/AudioBox.h>
 #include <framework/building/Door.h>
 #include <framework/building/DoorBell.h>
 #include <framework/building/Floor.h>
 #include <framework/building/Garden.h>
 #include <framework/building/House.h>
 #include <framework/building/Light.h>
 #include <framework/building/Room.h>
 #include <framework/building/Window.h>


using namespace wosh;
namespace wosh {
 namespace database {

void EncoderXML_register_Buildings();

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

class EncoderXML_template__BuildingObject : public EncoderXML_base  {

	public:
		virtual ISerializable* allocObject()		{ return new wosh::building::BuildingObject(); }

		virtual WRESULT serializeTo( const ISerializable* object, QDomDocument& doc, QDomElement& contNode, bool compact );

		virtual WRESULT deserializeFrom( ISerializable* object, const QDomElement& contNode );

	public:
		EncoderXML_template__BuildingObject() { }
		virtual ~EncoderXML_template__BuildingObject() { }

}; // class def

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

class EncoderXML_template__BuildingGeometry : public EncoderXML_base  {

	public:
		virtual ISerializable* allocObject()		{ return new wosh::building::BuildingGeometry(); }

		virtual WRESULT serializeTo( const ISerializable* object, QDomDocument& doc, QDomElement& contNode, bool compact );

		virtual WRESULT deserializeFrom( ISerializable* object, const QDomElement& contNode );

	public:
		EncoderXML_template__BuildingGeometry() { }
		virtual ~EncoderXML_template__BuildingGeometry() { }

}; // class def

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

class EncoderXML_template__Appliance : public EncoderXML_template__BuildingObject  {

	public:
		virtual ISerializable* allocObject()		{ return new wosh::building::Appliance(); }

		virtual WRESULT serializeTo( const ISerializable* object, QDomDocument& doc, QDomElement& contNode, bool compact );

		virtual WRESULT deserializeFrom( ISerializable* object, const QDomElement& contNode );

	public:
		EncoderXML_template__Appliance() : EncoderXML_template__BuildingObject() { }
		virtual ~EncoderXML_template__Appliance() { }

}; // class def

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

class EncoderXML_template__AudioBox : public EncoderXML_template__BuildingObject  {

	public:
		virtual ISerializable* allocObject()		{ return new wosh::building::AudioBox(); }

		virtual WRESULT serializeTo( const ISerializable* object, QDomDocument& doc, QDomElement& contNode, bool compact );

		virtual WRESULT deserializeFrom( ISerializable* object, const QDomElement& contNode );

	public:
		EncoderXML_template__AudioBox() : EncoderXML_template__BuildingObject() { }
		virtual ~EncoderXML_template__AudioBox() { }

}; // class def

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

class EncoderXML_template__Door : public EncoderXML_template__BuildingObject  {

	public:
		virtual ISerializable* allocObject()		{ return new wosh::building::Door(); }

		virtual WRESULT serializeTo( const ISerializable* object, QDomDocument& doc, QDomElement& contNode, bool compact );

		virtual WRESULT deserializeFrom( ISerializable* object, const QDomElement& contNode );

	public:
		EncoderXML_template__Door() : EncoderXML_template__BuildingObject() { }
		virtual ~EncoderXML_template__Door() { }

}; // class def

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

class EncoderXML_template__DoorBell : public EncoderXML_template__BuildingObject  {

	public:
		virtual ISerializable* allocObject()		{ return new wosh::building::DoorBell(); }

		virtual WRESULT serializeTo( const ISerializable* object, QDomDocument& doc, QDomElement& contNode, bool compact );

		virtual WRESULT deserializeFrom( ISerializable* object, const QDomElement& contNode );

	public:
		EncoderXML_template__DoorBell() : EncoderXML_template__BuildingObject() { }
		virtual ~EncoderXML_template__DoorBell() { }

}; // class def

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

class EncoderXML_template__Floor : public EncoderXML_template__BuildingObject  {

	public:
		virtual ISerializable* allocObject()		{ return new wosh::building::Floor(); }

		virtual WRESULT serializeTo( const ISerializable* object, QDomDocument& doc, QDomElement& contNode, bool compact );

		virtual WRESULT deserializeFrom( ISerializable* object, const QDomElement& contNode );

	public:
		EncoderXML_template__Floor() : EncoderXML_template__BuildingObject() { }
		virtual ~EncoderXML_template__Floor() { }

}; // class def

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

class EncoderXML_template__Garden : public EncoderXML_template__Floor  {

	public:
		virtual ISerializable* allocObject()		{ return new wosh::building::Garden(); }

		virtual WRESULT serializeTo( const ISerializable* object, QDomDocument& doc, QDomElement& contNode, bool compact );

		virtual WRESULT deserializeFrom( ISerializable* object, const QDomElement& contNode );

	public:
		EncoderXML_template__Garden() : EncoderXML_template__Floor() { }
		virtual ~EncoderXML_template__Garden() { }

}; // class def

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

class EncoderXML_template__House : public EncoderXML_template__BuildingObject  {

	public:
		virtual ISerializable* allocObject()		{ return new wosh::building::House(); }

		virtual WRESULT serializeTo( const ISerializable* object, QDomDocument& doc, QDomElement& contNode, bool compact );

		virtual WRESULT deserializeFrom( ISerializable* object, const QDomElement& contNode );

	public:
		EncoderXML_template__House() : EncoderXML_template__BuildingObject() { }
		virtual ~EncoderXML_template__House() { }

}; // class def

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

class EncoderXML_template__Light : public EncoderXML_template__Appliance  {

	public:
		virtual ISerializable* allocObject()		{ return new wosh::building::Light(); }

		virtual WRESULT serializeTo( const ISerializable* object, QDomDocument& doc, QDomElement& contNode, bool compact );

		virtual WRESULT deserializeFrom( ISerializable* object, const QDomElement& contNode );

	public:
		EncoderXML_template__Light() : EncoderXML_template__Appliance() { }
		virtual ~EncoderXML_template__Light() { }

}; // class def

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

class EncoderXML_template__Room : public EncoderXML_template__BuildingObject  {

	public:
		virtual ISerializable* allocObject()		{ return new wosh::building::Room(); }

		virtual WRESULT serializeTo( const ISerializable* object, QDomDocument& doc, QDomElement& contNode, bool compact );

		virtual WRESULT deserializeFrom( ISerializable* object, const QDomElement& contNode );

	public:
		EncoderXML_template__Room() : EncoderXML_template__BuildingObject() { }
		virtual ~EncoderXML_template__Room() { }

}; // class def

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

class EncoderXML_template__Window : public EncoderXML_template__BuildingObject  {

	public:
		virtual ISerializable* allocObject()		{ return new wosh::building::Window(); }

		virtual WRESULT serializeTo( const ISerializable* object, QDomDocument& doc, QDomElement& contNode, bool compact );

		virtual WRESULT deserializeFrom( ISerializable* object, const QDomElement& contNode );

	public:
		EncoderXML_template__Window() : EncoderXML_template__BuildingObject() { }
		virtual ~EncoderXML_template__Window() { }

}; // class def

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////////////////////////////////////

 }; // namespace database
}; // namespace wosh

#endif //__WOSH_DataBase_CoderXML_Building_H__
